using AFAD;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;

[Serializable]
public class SaveData {
    public int BestScore = 0;
    public int BestNum = 0;

    public void SetBestScore(int score) {
        BestScore = score;
        Save();
    }

    public void SetBestNum(int num) {
        BestNum = num;
        Save();
    }

    public void Save() {
        PlayerPrefs.SetString("SaveData", JsonUtility.ToJson(this));
    }
}

public class GameMgr : Singleton<GameMgr>
{
    public SaveData Save = new SaveData();
    public int MaxNum = 8192;

    public GameMgr() {
        if (PlayerPrefs.HasKey("SaveData")) {
            Save = JsonUtility.FromJson<SaveData>(PlayerPrefs.GetString("SaveData"));
        }
    }
}


public enum GameState { 
    Idle,
    Run,
    Pause,
    Over,
}